package com.unicom.map;

import java.util.HashMap;
import java.util.Iterator;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/12/13 10:26
 * Description:
 */
public class HashMapTest {


    public static void main(String[] args) {
        test();
    }

    public static void test() {
        HashMap map = new HashMap<String, Object>();

        map.put("java", "object");
        map.put("String", "tome");
        Object result = map.put("String", "tomas");
        System.out.println("put result: " + result);

        Iterator iterator = map.keySet().iterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            Object o = map.get(next);
            System.out.println("key: " + next + ", value: " + o);
        }

        Object java = map.remove("java");
        System.out.println("----remove : " + java);
    }
}
